home *** CD-ROM | disk | FTP | other *** search
- Path: lrz-muenchen.de!news
- From: watzka@stat.uni-muenchen.de (Kurt Watzka)
- Newsgroups: comp.lang.c
- Subject: Re: int main() vs int main(void)
- Date: 8 Feb 1996 14:10:41 GMT
- Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
- Distribution: world
- Message-ID: <4fd091$b8q@sparcserver.lrz-muenchen.de>
- References: <1996Feb7.201848.18734@atlas.tntech.edu>
- NNTP-Posting-Host: sun2.lrz-muenchen.de
-
- jad7084@tntech.edu (Jim Davis) writes:
-
- >Okay, void main() is naughty, but there's something else I've been
- >wondering about, and I can't find it in the FAQ.
-
- >Is there a difference between
-
- > int main()
- > int main(void)
-
- >? () is equivalent to (void), right? Does it matter? Am I worried about
- >nothing?
-
- 1) It depends on whether you are talking about C or about C++.
- 2) It depends on whether you are talking about a prototype or a
- function definition
- 3) It depends on wether you consider the different meanings in
- a prototype as relevant or not. Since you usually don't
- provide a prototype for main(), the answer seems to be yes.
-
- Kurt
- --
- | Kurt Watzka Phone : +49-89-2180-6254
- | watzka@stat.uni-muenchen.de
- | ua302aa@sunmail.lrz-muenchen.de
-